import upload from '@/utils/upload'
import request from '@/utils/request'

// 获取条码编码
export function getBarcodeNumber(assetType) {
  return request({
    url: '/asset/manager/getBarcodeNumber',
    method: 'GET',
	params:{
		assetType
	}
  })
}

// 上传文件
export function uploadFile(data) {
  return upload({
    url: '/admin-api/infra/file/upload',
    method: 'POST',
    name: data.name,
    filePath: data.filePath
  })
}

// 新增盘点
export function assetCreate(data) {
  return request({
    url: '/asset/manager/create',
    method: 'POST',
	data
  })
}

// 修改盘点
export function assetUpdate(data) {
  return request({
    url: '/asset/manager/update',
    method: 'PUT',
	data
  })
}

// 根据条码编码获取相信信息
export function getDetailByBarcodeNumber(barcodeNumber) {
  return request({
    url: '/asset/manager/getDetailByBarcodeNumber',
    method: 'GET',
	params:{
		barcodeNumber
	}
  })
}

// 分页获取
export function getAssetListPage(params) {
  return request({
    url: '/asset/manager/page',
    method: 'GET',
    params
  })
}
// 删除数据
export function removeAsset(params) {
  return request({
    url: '/asset/manager/delete',
    method: 'DELETE',
    params
  })
}